import { sendAdminCode } from './mail'
import redisDb from './redisconf'

export const reCode = async (IS_MAIL_SEND,to) => {
  // const IS_MAIL_SEND = false
  const { Random } = require('mockjs')
  const code = Random.string('lower',8)
  await redisDb.set(0,'code',{code})
  if(IS_MAIL_SEND)
    sendAdminCode({to,code})
}